//
// Created by user on 2022/1/17.
//
#include <iostream>
#include <vector>
#include <string>

using namespace std;
vector<string> summaryRanges(vector<int>& nums) {
    vector<string> res;
    int i = 0;
    while (i<nums.size()){
        int low = i;
        i++;
        //找到非连续的点
        while (i<nums.size() && nums[i]==nums[i-1]+1){i++;}
        int high = i-1;
        string sb = to_string(nums[low]);
        if(low<high){
            sb.append("->");
            sb.append(to_string(nums[high]));
        }
        res.push_back(sb);
    }
    return res;
}


int main(){
    std::string s = "xmplr";

    // insert(size_type index, size_type count, char ch)
    s.insert(1, 2, 'E');
    cout<<s<<endl;

    return 0;
}

